package com.one.service;

import com.one.bean.CollectFootpoint;
import com.one.util.PageUtil;
import com.one.util.RequestReturn;
import com.one.vo.CollectFootpointVo;

import java.util.List;

/**
 * @ClassName: CollectFootpointService
 * @Auther: yph
 * @Date: 2022/1/19 14:31
 * @Description: 用户收藏足迹业务层接口
 */
public interface CollectFootpointService {

    /**
     * @Author: yph
     * @Date: 2022/1/19 14:33
     * @return:
     * @Description: 根据用户id查询用户最近一个月内的浏览记录
     */
    RequestReturn<PageUtil<List<CollectFootpointVo>>> queryFootpointByUserId(Integer userId, Integer pageNo, Integer pageSize);

    /**
     * @Author: yph
     * @Date: 2022/1/19 15:28
     * @return:
     * @Description: 收藏，取消收藏
     */
    RequestReturn<String> collectProductToRedis(Integer userId, Integer productId);

    /**
     * @Author: yph
     * @Date: 2022/1/19 15:28
     * @return:
     * @Description: 收藏，取消收藏
     */
    RequestReturn<String> collectProductsToRedis(Integer userId, List<Integer> productId);


    /**
     * @Author: yph
     * @Date: 2022/1/19 15:56
     * @return:
     * @Description: 将redis中数据同步到mysql中
     */
    boolean collectProductToMysql(CollectFootpoint collectFootpoint);

    /**
     * @Author: yph
     * @Date: 2022/1/19 17:13
     * @return:
     * @Description: 删除数据库中数据
     */
    boolean deleteCollectProduct(String userId, String productId);

    /**
     * @Author: yph
     * @Date: 2022/1/19 18:26
     * @return: 
     * @Description: 根据用户id查询用户的收藏列表
    */
    RequestReturn<List<CollectFootpointVo>> queryCollectProduct(Integer userId);

    /**
     * @Author: yph
     * @Date: 2022/1/21 22:36
     * @return: 
     * @Description: 清空收藏夹
    */
    RequestReturn<String> clearUserCollect(Integer userId);

    /**
     * @Author: yph
     * @Date: 2022/1/22 00:08
     * @return: 
     * @Description: 清空用户足迹
    */
    RequestReturn<String> clearUserFootPoint(Integer userId);
}
